from rest_framework import serializers


from Stage.models import Stage
from module.models import Module
from task.models import Task
from user.models import User, Clazz, UserTask

#任务的序列化器
class TaskSerializers(serializers.ModelSerializer):
    module=serializers.ReadOnlyField(source='module.name')
    stage =serializers.ReadOnlyField(source='stage.name')


    class Meta:
        model = Task
        fields = '__all__'
        depth = 1

class UserTaskSerializers(serializers.ModelSerializer):

    class Meta:
        model = UserTask
        fields = '__all__'
        depth = 2



